chore: add DeletePrincipalGrantByTuple SQLc query#1885
Conversation
Adds a query to delete a single grant by its (org, principal, scope, resource) tuple, matching the unique constraint on the table.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
| func (q *Queries) DeletePrincipalGrantByTuple(ctx context.Context, arg DeletePrincipalGrantByTupleParams) (int64, error) { | ||
| result, err := q.db.Exec(ctx, deletePrincipalGrantByTuple, | ||
| arg.OrganizationID, | ||
| arg.PrincipalUrn, | ||
| arg.Scope, | ||
| arg.Resource, | ||
| ) | ||
| if err != nil { | ||
| return 0, err | ||
| } | ||
| return result.RowsAffected(), nil | ||
| } |
There was a problem hiding this comment.
🚩 New query has no callers or tests yet
The DeletePrincipalGrantByTuple function is defined but has zero callers anywhere in the codebase and no corresponding tests. The CONTRIBUTING.md guidelines state "Add tests for all new contributions." While this is auto-generated sqlc code and may be a preparatory change for a follow-up PR that will add callers and tests, it's worth confirming this is intentional and that tests will accompany the consuming code.
Was this helpful? React with 👍 or 👎 to provide feedback.
Summary
DeletePrincipalGrantByTupleSQLc query to delete a single grant by its exact(organization_id, principal_urn, scope, resource)tupleprincipal_grantstable, enabling precise single-grant removalPart of AGE-1566.